package com.lfy.modules.common.config;

import com.lfy.modules.common.intercept.LogIntercept;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

@Configuration
public class InterceptConfig implements WebMvcConfigurer {
    @Resource
    private LogIntercept logIntercept;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(logIntercept).addPathPatterns("/**");
        WebMvcConfigurer.super.addInterceptors(registry);
    }
}
